﻿using System;
using System.Collections.Generic;
using AudioCore.DAO;
using AudioCore.Entity;
using System.Data;

namespace AudioCore.Biz
{
    public class ItemTypeBiz : BaseBiz
    {
        public List<ItemTypeEntity> GetAllItemType()
        {
            try
            {
                using (ItemTypeDao dao = new ItemTypeDao())
                {
                    DataTable table = dao.SelectAllItem();
                    if (table.Rows.Count > 0)
                    {
                        return BaseBiz.MapDataTableToList(table, typeof(ItemTypeEntity)).ConvertAll(item => (ItemTypeEntity)item);
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return new List<ItemTypeEntity>();
        }
    }
}
